<?php

namespace Database\Seeders;

use App\Models\Section;
use Illuminate\Database\Seeder;

class SectionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $sections = [
            ['name' => '一级部门', 'pid' => 0, 'status' => 1, 'level' => 1],
            ['name' => '二级部门', 'pid' => 1, 'status' => 1, 'level' => 2],
            ['name' => '二级部门2', 'pid' => 1, 'status' => 1, 'level' => 2],
            ['name' => '三级部门1', 'pid' => 2, 'status' => 1, 'level' => 3],
            ['name' => '三级部门2', 'pid' => 2, 'status' => 1, 'level' => 3],
            ['name' => '三级部门3', 'pid' => 3, 'status' => 1, 'level' => 3],
            ['name' => '三级部门3', 'pid' => 3, 'status' => 1, 'level' => 3]
        ];


        foreach ($sections as $section){
            Section::create($section);
        }
    }
}
